package com.neuedu.hw_20190215;

public class ComputerDepartment extends Student{
    //成员变量
    private Double operationScore;
    private Double engWriting;
    private Double finalExam;
    private Double middleExam;
    //行为方法

    public Double totalscore() {
        Double myTotalScore = operationScore*0.4+engWriting*0.2+finalExam*0.2+middleExam*0.2;
        return (double)Math.round(myTotalScore*100)/100;
    }


    //自定义构造方法

    public ComputerDepartment(String stuID, String stuName, String strSex, int stuAge, Double operationScore, Double engWriting, Double finalExam, Double middleExam) {
        super(stuID, stuName, strSex, stuAge);
        this.operationScore = operationScore;
        this.engWriting = engWriting;
        this.finalExam = finalExam;
        this.middleExam = middleExam;
    }


    //显示默认构造方法

    public ComputerDepartment() {
    }

    //为私有成员变量提供setter和getter方法

    public Double getOperationScore() {
        return operationScore;
    }

    public void setOperationScore(Double operationScore) {
        this.operationScore = operationScore;
    }

    public Double getEngWriting() {
        return engWriting;
    }

    public void setEngWriting(Double engWriting) {
        this.engWriting = engWriting;
    }

    public Double getFinalExam() {
        return finalExam;
    }

    public void setFinalExam(Double finalExam) {
        this.finalExam = finalExam;
    }

    public Double getMiddleExam() {
        return middleExam;
    }

    public void setMiddleExam(Double middleExam) {
        this.middleExam = middleExam;
    }
}
